/**
 *    Copyright 2009-2020 the original author or authors.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package org.apache.ibatis.aapl.annotation.strategy;

/**
 * 对传入的字段进行增强，并使用增强后的字段来覆盖之前的值。
 * 举例：
 * 用户User中有一个字段为ipAddress
 * 前台传来的地址是 255.255.255.255格式的
 * 但是后台存储需要更改为 32位进行存储
 * 那么只需使用注解来进行增强
 * 将该字段的值（255.255.255.255）传入到增强策略当中去
 * 然后进行相应处理，即可获得得出的值（32位无符号整数）
 *
 * @author gu
 * @date 2020/4/3 16:15
 */
public interface EnhanceEarlyFieldStrategy {
  /**
   * 对字段进行增强
   * o为传入的字段值（而非对象）
   *
   * @param o 传入的对象，可能为null
   * @return 将用来填充对象的字段，可以为null
   */
  Object enhance(Object o);
}
